<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	
	<xsl:template match="*"></xsl:template>
	
	<xsl:template match="content">
		<h3>Привет из шаблона контента действия EDIT</h3>
		
		<!-- эта форма будет обработана шаблоном XForms -->
		<XForm>
			<xsl:apply-templates select="object" />
		</XForm>
		
	</xsl:template>
	
	<!-- объект -->
	<xsl:template match="object">
		<xsl:apply-templates select="field" mode="object_field" />
		<xsl:apply-templates select="object" mode="child" />
		
		<input type="submit" value="Сохранить" />
	</xsl:template>
	
	<!-- тип данных по умолчанию -->
	<xsl:template match="field" mode="object_field">
		<label><xsl:value-of select="@name" /></label>
		<input type="text" name="{@name}" value="{text()}" disable-output-escaping="no" />
	</xsl:template>
	
	<!-- поле типа текст -->
	<xsl:template match="field[@type='text']" mode="object_field">
		<label><xsl:value-of select="@name" /></label>
		<textarea name="{@name}"><xsl:value-of select="text()" /></textarea>
	</xsl:template>
	
	<!-- поле типа число -->
	<xsl:template match="field[@type='int(11)']" mode="object_field">
		<label><xsl:value-of select="@name" /></label>
		<input type="text" name="{@name}" value="{text()}" size="16" />
	</xsl:template>
	
	<!-- дочерние объекты -->
	<xsl:template match="object" mode="child">
		<fieldset>
			<legend>Объект</legend>
			<input name="picture" type="file" />
			<dl>
				<dt>repeat</dt>
			</dl>
		</fieldset>
	</xsl:template>

	<!-- дочерние объекты класса Picture -->
	<xsl:template match="object[@class='Picture']" mode="child">
		<!-- <fieldset name="pictures">
			
			<legend>Картинки</legend>
			<fieldset>
				<input name="file" type="text" />
				<input name="alt" type="file" />
			</fieldset>
			<dl>
				<dt>repeat</dt>
			</dl>
			
			
		</fieldset>
		 -->
		
	<fieldset name="pictures">
		<legend>Картинки</legend>
		<fieldset>
			
			<textarea class="HTML" name="{@name}">привет</textarea>
			<dl>
				<dt>comment</dt>
				<dd>
					<div>
						<a href="http://hjhjhj" target="_blank">ссылка на картинку</a>
						<span class="preview">
							<img src="taint[xml][hParams.sPath/hParams.tData.file_name]" alt="" />
						</span>
					</div>
					340×49
				</dd>
			</dl>

			<input type="text" name="{@name}" value="{text()}" disable-output-escaping="no" />
			<input name="file" type="file" />
		</fieldset>
		<dl>
			<dt>repeat</dt>
		</dl>
	</fieldset>
			
	</xsl:template>



<!-- 
<div class="fieldset resource image no_remove no_append widget-inited" id="id62344509">
	<strong class="legend">Малое изображение</strong>
	<div class="reducer">
		
		<dl class="row for_textarea HTML widget-inited removed" id="r_preview-photo_description">
			<dt class="label">
				
				<label for="preview-photo_description"/>
				<ins class="comment">
					<a target="_blank" href="/r/74C93A4A-1B8F-4CD4-8EDC-69D905BED3A5/Bolivar-Tubos-No.-1_sm.jpg">Bolivar-Tubos-No.-1_sm.jpg</a>
					<span class="preview">
						<img alt="" src="/r/74C93A4A-1B8F-4CD4-8EDC-69D905BED3A5/Bolivar-Tubos-No.-1_sm.jpg"/>
					</span>
					340×49
				</ins>
				
				
			</dt>
			<dd class="field">
				<textarea rows="5" cols="30" class="text HTML" id="preview-photo_description" name="preview-photo_description"/>
			</dd>
		</dl>
		
		<dl>
			<dt class="label"><label for="preview-photo_file"/></dt>
			<dd class="field"><input type="file" class="file" id="preview-photo_file" name="preview-photo_file"/></dd>
		</dl>
		
		
		<dl class="row for_selector type_checkbox flag widget-inited" id="r_preview-photo_remove">
			<dt class="label"/>
			<dd class="field">
				<div class="selector widget-inited selected" id="r_preview-photo_remove_i2">
					<input type="checkbox" value="1" id="preview-photo_remove_i2" name="preview-photo_remove"/>
					<label for="preview-photo_remove_i2">Удалить</label>
				</div>
			</dd>
		</dl>
	</div>
</div>
 -->


</xsl:stylesheet>